#include <iostream>
#include <string>
#include <stack>

#include "directorymanager.hpp"

using namespace std;

int main()
{
    int no;
    string ordre1, ordre2;
    directoryManager dirman((char*)"prova");

    while(!cin.eof())
    {
        cin >> no >> ordre1 >> ordre2;
        if(ordre1 == string("make")) {
            cout << "COMANDA " << no << " - ";
            dirman.make(ordre2);
        }
        else if(ordre1 == string("delete"))
        {
            cout << "COMANDA " << no << " - ";
            dirman.del(ordre2);
        }
        else if(ordre1 == string("list"))
        {
            cout << "COMANDA " << no << " - ";
            dirman.list(ordre2);
        }
        else if(ordre2 == string("addpag"))
        {
            cout << "COMANDA " << no << " - ";
            dirman.addpag(ordre1);
        }
        else if(ordre2 == string("delpag"))
        {
            cout << "COMANDA " << no << " - ";
            dirman.delpag(ordre1);
        }
        // Final d'arxiu o error de sintaxi
        else if(ordre1 == "" && ordre2 == "") {}
        else cout << "ERROR de sintaxi E/S" << endl;
        ordre1 = ordre2 = "";
    }
}

